<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>用户输入</title>
<meta name="description" content="">
<meta name="keywords" content="">
<link href="" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <p>{{ message }}</p>
        <button v-on:click="reverseMessage">逆转消息</button>
    </div>
    <!-- v-model 指令，它能轻松实现表单输入和应用状态之间的双向绑定。  -->
    <div id="app-2">
        <p>{{message}}</p>
        <input type="text" v-model="message">
    </div>
    <script>
        var app = new Vue({
            el:'#app',
            data:{
                message:'Hello Vue.js'
            },
            methods:{
                reverseMessage:function(){
                    this.message = this.message.split('').reverse().join('')
                }
            }
        })

        var app2 = new Vue({
            el:'#app-2',
            data: {
                message:'Hello Vue!'
            }
        })
    </script>
</body>
</html>